<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>

    <h:form id="ugovorOKredituSelection" styleClass="edit">
    
        <rich:panel>
         
     <rich:dataTable id="statusZahtevaList" value="#{kreditniZahtevHome.instance.status}" >

        <h:column>
        	<f:facet name="header">
				Podnosilac zahteva 
            </f:facet>
            #{ulogovaniKorisnik.ime} #{ulogovaniKorisnik.prezime}
        </h:column>
       
        <h:column>
        	<f:facet name="header">
				Broj zahteva 
            </f:facet>
            #{kreditniZahtevHome.instance.brojZahteva}
        </h:column>
        <h:column>
        	<f:facet name="header">
				Datum podnosenja
            </f:facet>
            #{kreditniZahtevHome.instance.datumZahteva}
        </h:column>
        <h:column>
        	<f:facet name="header">
			Iznos kredita 
            </f:facet>
			#{kreditniZahtevHome.instance.iznos} (#{kreditniZahtevHome.instance.valuta.oznaka})
        </h:column>
        <h:column>
        	<f:facet name="header">
				Rocnost
            </f:facet>
            #{kreditniZahtevHome.instance.rok} (#{kreditniZahtevHome.instance.tipRocnosti.naziv})
        </h:column>
        <h:column>
        	<f:facet name="header">
				Trenutni status
            </f:facet>
            #{statusZahtevaHome.instance.status.naziv}
        </h:column>
       

        <h:column>
            <f:facet name="header">Akcije</f:facet>

		    <s:button view="/UgovorOKredituEdit.xhtml"
	                    id="create" 
	                 value="Otvori ugovor"
	                 rendered="#{ugovorOKredituHome.verifikovan}">
	            <f:param name="ugovorOKredituId"/>
            	<f:param name="statusId" value="#{statusHome.instance.id}" />     
      			<f:param name="statusZahtevaId" value="#{statusZahtevaHome.instance.id}" />
                <f:param name="kreditniZahtevId" value="#{kreditniZahtevHome.instance.id}" />   
	        </s:button>
        </h:column>
       </rich:dataTable>
   </rich:panel>
   <rich:panel>      
       <h:outputText value="Niste uneli ispravan maticni broj. Pokusajte ponovo." 
               rendered="#{ugovorOKredituHome.brojLogovanja != 0}"/>


              <s:decorate template="layout/display.xhtml">
                <ui:define name="label">JMBG</ui:define>
                <h:inputText id="JMBG" value="#{ugovorOKredituHome.jmbgIn}"/>
            </s:decorate>    
                        
            <div style="clear:both">
                <span class="required">*</span> 
                obavezna polja
            </div>
            
        </rich:panel>
                
        <div class="actionButtons">

            <h:commandButton id="verifikuj" 
                          value="Verifikuj" 
                         action = "#{ugovorOKredituHome.verifikuj}"	
                       disabled="#{!ugovorOKredituHome.wired}"
                       rendered="#{!ugovorOKredituHome.managed}"/>  
 
        </div>
    </h:form>

</ui:define>

</ui:composition>
